function h = applyOneBlock(coef, bx, by, T)
  [M,N]=size(coef);
  p = coef(bx:8:M, by:8:N);
  [M1,N1] = size(p);
  p2 = reshape(p,1,M1*N1);
  h = histc(p2, -T:T);
  s = sum(h);
  if (s ~= 0)
      h = h/s;
  end
end
